<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/8/14
 * Time: 15:45
 */

namespace App\Models;


use App\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Model;

class Order extends Model
{
    use HasDateTimeFormatter;
    protected $table = "order";
    protected $fillable = ['mid','order_no','room_id','building_no','floor_no','room_no','water_type','num','price','prepare_id','status', 'notify_json','transaction_id','total_price','user_id','pay_at','delivery_at','is_send_delivery'];

    public function userItem()
    {
        return $this->belongsTo(Administrator::class,'user_id','id');
    }

    public function memberItem()
    {
        return $this->belongsTo(Member::class,'mid','id');
    }
}
